package com.codetree.strategy.simple.strategy_example.strategy;

import com.codetree.strategy.simple.strategy_example.PaymentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

@Slf4j
@Component
public class AlipayStrategy implements PaymentService {
    @Override
    public String pay(String type, BigDecimal amount) {
        try {
            Thread.sleep(2000);
        } catch (Exception e) {
            log.info("异常", e);
        }
        return "支付宝支付成功，金额：" + amount;
    }
}
